package bid.yanhj.springboot.quartz;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import bid.yanhj.springboot.service.UsersService;

/**
 * 定义任务类
 *
 *
 */
public class QuartzDemo implements Job {

    @Autowired
    private UsersService usersService;

    /**
     * 任务被触发时所执行的方法
     */
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // TODO Auto-generated method stub
        System.out.println("Execute...."+new Date());
        
        this.usersService.addUserTest();
    }
}
